﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CodeGame.Networking.Clientside;

namespace CodeGame.LuaLibary
{
    static class luaLib_database
    {
        [LuaHelp("Sets a key in the database")]
        public static void set(string table, string key, string value)
        {
            ClientProtocolDatabase.SetKey(table, key, value);
        }

        [LuaHelp("Gets a key in the database")]
        public static void get(string table, string key)
        {
            ClientProtocolDatabase.GetKey(table, key);
        }

        [LuaHelp("Add a key to the database using a auto generated number index")]
        public static void add(string table, string value)
        {
            ClientProtocolDatabase.AddValue(table, value);
        }

        [LuaHelp("Sends all keys in a database table")]
        public static void getAll(string table)
        {
            ClientProtocolDatabase.GetAllKeys(table);
        }
    }
}
